from import_export import resources
from import_export.fields import Field

from polls.models import TRXValue, Address


class TRXvalueResource(resources.ModelResource):
    the_address = Field(column_name='地址')

    class Meta:
        model = TRXValue

    @staticmethod
    def dehydrate_the_address(instance: TRXValue):
        return instance.address.address
